import java.util.*;
import java.lang.*;
import java.math.*; 

public class SRM500 {

	//II-1
	public static int maxTurns(int[] cards)
	{
		int number = 0;
		Arrays.sort(cards);
		
		for(int i = 0; i<cards.length; i++)
		{
			if(i == cards.length-1)
			{
				number++;
				continue;
			}
			else if(cards[i]+1 == cards[i+1])
			{
				i++;
			}
			number++;
		}		
		return number;
	
	}
	
}
